#include "AllHeaders.h"

Node::Node()
{
	Right = NULL;
	Left = NULL;
}

Node::Node(int _Color[3], int _posX, int _posY, int _posDX, int _posDY)
{
	for (int i = 0; i < 3; i++)
		Color[i] = _Color[i];

	posX = _posX;
	posY = _posY;

	posDX = _posDX;
	posDY = _posDY;

	Right = NULL;
	Left = NULL;
}

Node::~Node()
{
}

void Node::SetRight(Node* _Right)
{
	Right = _Right;
}

Node* Node::GetRight()
{
	return Right;
}

void Node::SetLeft(Node* _Left)
{
	Left = _Left;
}

Node* Node::GetLeft()
{
	return Left;
}

void Node::SetColor(int _r, int _g, int _b)
{
	Color[0] = _r;
	Color[1] = _g;
	Color[2] = _b;
}

int Node::GetColorR()
{
	return Color[0];
}

int Node::GetColorG()
{
	return Color[1];
}

int Node::GetColorB()
{
	return Color[2];
}

void Node::SetPosX(int _posX)
{
	posX = _posX;
}

int Node::GetPosX()
{
	return this->posX;
}

void Node::SetPosY(int _posY)
{
	posY = _posY;
}

int Node::GetPosY()
{
	return posY;
}

void Node::SetPosDX(int _posDX)
{
	posDX = _posDX;
}

int Node::GetPosDX()
{
	return posDX;
}

void Node::SetPosDY(int _posDY)
{
	posDY = _posDY;
}

int Node::GetPosDY()
{
	return posDY;
}

Node& Node::operator=(Node& _node)
{

	Color[0] = _node.GetColorR();
	Color[1] = _node.GetColorG();
	Color[2] = _node.GetColorB();

	posX = _node.GetPosX();
	posY = _node.GetPosY();

	posDX = _node.GetPosDX();
	posDY = _node.GetPosDY();

	Right = _node.GetRight();
	Left = _node.GetLeft();

	return *this;
}

bool Node::operator==(Node& _node)
{
	int Cor[3];

	Cor[0] = _node.GetColorR();
	Cor[1] = _node.GetColorG();
	Cor[2] = _node.GetColorB();

	if ((this->Color[0] == Cor[0]) && (this->Color[1] == Cor[1]) && (this->Color[2] == Cor[2]))
		return true;
	else
		return false;
}

																	  






